package org.csmzxy.class2333;

public class Example24 {
    public static int divide(int num1,int num2){
        if (num2 == 0){
            throw new ArithmeticException("除数不能为0");
        }
        return num1 / num2;
    }
    public static  void main(String[] args){
        int num1 = 10;
        int num2 = 0;
        int result = num1 / num2;
        System.out.println("10除以0以外的结果是"+ result);
    }
}